package app.travel.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.BasicRowProcessor;
import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import app.travel.model.Fangjian;

public class FangjianDao extends BaseDao {

	ResultSetHandler<List<Fangjian>> rsh = new BeanListHandler<Fangjian>(Fangjian.class,
			new BasicRowProcessor());

	public List<Fangjian> select(Fangjian fangjian) {
		List<Fangjian> fjList = null;
		Connection conn = null;
		try {
			conn = this.getConnection();
			fjList = new QueryRunner().query(conn, "select * from agile.fangjian", this.rsh);
		} catch (Exception e) {
			try {
				DbUtils.close(conn);
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
			e.printStackTrace();
		}
		return fjList;
	}

	public static void main(String[] args) throws IllegalArgumentException, IllegalAccessException {

	}
}
